package com.depin.pdaapp.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.device.ScanManager;
import android.util.Log;


import com.depin.pdaapp.event.MyEvent;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by lzn.
 * Date：2020/9/7 10:27
 * Desc：
 **/
public class ScanReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String barcode= intent.getStringExtra(ScanManager.BARCODE_STRING_TAG);
        Log.e("data",barcode);
        EventBus.getDefault().post(new MyEvent.MessageEvent(barcode));
    }
}